class MyClass {
  [s: string]: boolean | ((s: string) => boolean)

  x = true

  check(s: string) {
    console.log(this[s]);
    console.log(this);
    return this[s] as boolean
  }
}
const p3 = new MyClass()
p3.check('111')